#include <iostream>
#include "MeleeAutoAttack.h"
#include "StatusComponent.h"
#include "CombatComponent.h"
#include "Entity.h"
#include "Game.h"

REGISTERABILITY(MeleeAutoAttack, Create);

const HashedString MeleeAutoAttack::type("MeleeAutoAttack");

Pointer<Combat::IAbility> MeleeAutoAttack::Create( Combat::Combatant* owner )
{
	Pointer<Combat::IAbility> ability = new MeleeAutoAttack( owner );
	
	return ability;
}

MeleeAutoAttack::MeleeAutoAttack( Combat::Combatant* owner ) : TargettedAbility(owner)
{
	m_cooldown = 2;
	m_range = 5;
}

void MeleeAutoAttack::Activate( Combat::Combatant* target, Combat::Response& response )
{
	response.physicalDamage = m_owner->PhysicalDamage();
	response.specialDamage = m_owner->SpecialDamage();
	response.trueDamage = 0;
}

const HashedString& MeleeAutoAttack::Type()
{
	return type;
}